cmake_minimum_required(VERSION 3.17)
project(DVSubgraphMatching LANGUAGES CXX CUDA)
add_library(SubGraphMine src/miningPattern.cu src/reduction.cu)
set_target_properties(SubGraphMine PROPERTIES CUDA_ARCHITECTURES "75")
target_compile_features(SubGraphMine PUBLIC cxx_std_11)
SET(CMAKE_CXX_FLAGS_DEBUG "$ENV{CXXFLAGS} -O0 -Wall -g -ggdb")
SET(CMAKE_CUDA_FLAGS_DEBUG "-g -G --ptxas-options=-v")
SET(CMAKE_CXX_FLAGS_RELEASE "$ENV{CXXFLAGS} -O3 -Wall")
SET(CMAKE_CUDA_FLAGS_RELEASE "-O3")
include_directories(include /opt/cuda/targets/x86_64-linux/include)

add_executable(cpumine src/cpumine.cpp src/genMatchOrderCPU.cpp src/loadDataBase.cpp)
add_executable(gpumine src/gpumine.cpp src/loadDataBase.cpp src/genMatchOrder.cpp)
add_executable(gpumine_detail src/gpumine_detail.cpp src/loadDataBase.cpp src/genMatchOrder.cpp)
add_executable(gpumineSV src/gpumine_singleV.cpp src/loadDataBase.cpp src/genMatchOrderSingleV.cpp)
add_executable(gpumineSV_detail src/gpumine_singleV_detail.cpp src/loadDataBase.cpp src/genMatchOrderSingleV.cpp)
target_link_libraries(gpumine SubGraphMine)
target_link_libraries(gpumine_detail SubGraphMine)
target_link_libraries(gpumineSV SubGraphMine)
target_link_libraries(gpumineSV_detail SubGraphMine)

add_executable(genDatabase tools/genDatabase.cpp)
add_executable(genQuery tools/genQuery.cpp)
add_executable(calDVPhase tools/classifyExtPhase.cpp tools/calDVPhaseCount.cpp)
add_executable(evalAccessTime tools/evalAccessTime.cu)
set_target_properties(evalAccessTime PROPERTIES CUDA_ARCHITECTURES "75")
